<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue绑定事件</title>
</head>
<body>


<div id="app">
    <button v-on:click="sayHi">submit</button>
    <button @click="sayHi">简写 submit</button>
</div>


<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"> </script>
<script>
    var vm = new Vue({
        el:"#app",
        data:{
            message:"吴吉凯"
        },
        methods:{
            //方法必须定义在Vue的Methods对象中
            sayHi:function (event) {
                alert(this.message)
            }
        }
    });
</script>

</html>